package org.yx.bean;

import io.minio.MinioClient;
import org.yx.utils.Config;

public class MinioClientBean {
    private static MinioClientBean clientBean;
    MinioClient client = null;

    private MinioClientBean(){

    }

    static {
        clientBean = new MinioClientBean();
        clientBean.init();
    }

    public static MinioClientBean getInstance(){
        return clientBean;
    }

    private void init() {
        try {
            client = new MinioClient(Config.getString("file.minio.endpoint"),
                    Config.getString("file.minio.accesskey"),
                    Config.getString("file.minio.secretkey"));
        } catch (Exception ex) {
        }
    }

    public MinioClient getClient(){
        return client;
    }
}
